package com.renhui.android.handwriting.common;

import android.annotation.SuppressLint;
import android.content.Context;
import android.net.wifi.WifiManager;
import android.util.Log;

import java.lang.reflect.Field;

/**
 * Android P接口限制
 */
public class PReflectionUtils {

    @SuppressLint("SoonBlockedPrivateApi")
    public static void getWifiReflection(Context context) {
        WifiManager wifiManager = (WifiManager) context.getApplicationContext().getSystemService(Context.WIFI_SERVICE);
        try {
            Field field = wifiManager.getClass().getDeclaredField("WIFI_SCAN_AVAILABLE");
            Log.e("PReflectionUtils", (String) field.get(wifiManager));
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

}
